package be.xios.ti.droodle;

import java.awt.*;

/**
 * basisklasse voor alle mogelijke vormen
 * 
 * @author kris
 */
public abstract class Shape {
	private Color color;
	private int x;
	private int y;
	private int size;
	private boolean filled;
	
	/**
	 * maak een shape object, dit kan natuurlijk enkel
	 * via de subklassen, vandaar "protected"
	 * @param color de kleur
	 * @param x de x-coördinaat
	 * @param y de y-coördinaat
	 * @param size de dikte van de lijn in pixels
	 * @param filled al dan niet gevuld
	 */
	protected Shape(Color color, int x, int y, int size, boolean filled) {
		this.color = color;
		this.x = x;
		this.y = y;
		this.size = size;
		this.filled = filled;
	}
	
	protected Shape() {
		color = null;
		x = 0;
		y = 0;
		size = 1;
		filled = false;
	}
	
	/**
	 * deze methode wordt in de subklassen geschreven
	 * om een shape concreet te tekenen op een canvas
	 * @param g de graphics context
	 */
	protected abstract void draw(Graphics g);
	
	/**
	 * @return Returns the color.
	 */
	public Color getColor() {
		return color;
	}
	/**
	 * @return Returns the x.
	 */
	public int getX() {
		return x;
	}
	/**
	 * @return Returns the y.
	 */
	public int getY() {
		return y;
	}
	/**
	 * @return Returns the filled.
	 */
	public boolean isFilled() {
		return filled;
	}
	/**
	 * @return Returns the size.
	 */
	public int getSize() {
		return size;
	}
	/**
	 * @param color The color to set.
	 */
	public void setColor(Color color) {
		this.color = color;
	}
	/**
	 * @param filled The filled to set.
	 */
	public void setFilled(boolean filled) {
		this.filled = filled;
	}
	/**
	 * @param size The size to set.
	 */
	public void setSize(int size) {
		this.size = size;
	}
	/**
	 * @param x The x to set.
	 */
	public void setX(int x) {
		this.x = x;
	}
	/**
	 * @param y The y to set.
	 */
	public void setY(int y) {
		this.y = y;
	}
}
